/**
  ******************************************************************************
  * @file    key.h
  * @author  LZJ
  * @version V0.0.1
  * @date    2025/10/15
  * @brief   Header for key.c module
  ******************************************************************************
  */

#ifndef _KEY_H_
#define _KEY_H_


#include "stm32f4xx.h"
#include "stm32f4xx_gpio.h"

#define KEY_UP_GPIO GPIOA
#define KEY_UP_Pin  GPIO_Pin_0

#define KEY0_GPIO   GPIOE
#define KEY0_Pin    GPIO_Pin_4

#define KEY1_GPIO   GPIOE
#define KEY1_Pin    GPIO_Pin_3

#define KEY2_GPIO   GPIOE
#define KEY2_Pin    GPIO_Pin_2


#define KEY_UP_VAL  GPIO_ReadInputDataBit(KEY_UP_GPIO, KEY_UP_Pin)
#define KEY0_VAL    GPIO_ReadInputDataBit(KEY0_GPIO, KEY0_Pin)
#define KEY1_VAL    GPIO_ReadInputDataBit(KEY1_GPIO, KEY1_Pin)
#define KEY2_VAL    GPIO_ReadInputDataBit(KEY2_GPIO, KEY2_Pin)


void key_init(void);
uint8_t key_scan(void);


#endif
